{% extends "./inc/base.html" %}
{% block content %}
                <section class="vbox">
                    <header class="header bg-light dk">
                        <p>{{controller.meta_title}}</p>
                    </header>
                    <section class="scrollable wrapper">

                        <section class="panel panel-default">
                            <div class="table-responsive" style="position: relative;overflow: auto;width: 100%;">
                                <table class="table table-hover b-t b-light" style="table-layout: fixed;">
                                    <thead>
                                    <tr>
                                        <th style="width:60px;">序号</th>
                                        <th style="width:120px;">订单编号</th>
                                        <th style="width:100px;">下单方类型</th>
                                        <th style="width:150px;">下单方姓名</th>
                                        <th style="width:250px;">下单方公司名称</th>
                                        <th style="width:150px;">商品类别</th>
                                        <th style="width:150px;">所在地区</th>
                                        <th style="width:100px;">信息类型</th>
                                        <th style="width:100px;">信息通道</th>
                                        <th style="width:150px;">买方/委托方电话</th>
                                        <th style="width:150px;">买方/委托方姓名</th>
                                        <th style="width:250px;">买方/委托方公司</th>
                                        <th style="width:150px;">卖方/承接方电话</th>
                                        <th style="width:150px;">卖方/承接方姓名</th>
                                        <th style="width:250px;">卖方/承接方公司</th>
                                        <th style="width:150px;">下单时间</th>
                                        {# <th style="width:150px;">审核时间</th>
                                        <th style="width:100px;">审核结果</th>
                                        <th style="width:100px;">退回类型</th> #}
                                        <th style="width:100px;">存续状态</th>
                                        <th style="width:100px;">确认状态</th>
                                        
                                        <th class="text-center" style="width:100px;">订单详情</th>
                                        <th class="text-center" style="width:150px;">操作</th>
                                        {# <th style="width:100px;">备注</th> #}
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for item in list %}
                                    <tr >
                                        <td class="text-center">{{loop.index}}</td>
                                        <td><a href="/admin/order/see/?id={{item.id}}" class="text-info" data-toggle="ajaxModal">{{item.order_no}}</a></td>
                                        <td>{{item.order_userinfo.groupid|get_groupname}}</td>
                                        <td>{% if item.order_userid==item.xuid%}{{item.xu_username}}{%else%}{{item.gong_username}}{%endif%}</td>
                                        <td>{% if item.order_userid==item.xuid%}{{item.xu_gsmc}}{%else%}{{item.gong_gsmc}}{%endif%}</td>
                                        <td>{{item.shangpingleibie}}</td>
                                        <td>{{item.diqu}}</td>
                                        <td>{{item.yewuleixing|get_gongxutype}}</td>
                                        <td>{{item.info_channel|get_channelname}}</td>
                                        <td>{{item.xu_mobile}}</td>
                                        <td>{{item.xu_username}}</td>
                                        <td>{{item.xu_gsmc}}</td>
                                        <td>{{item.gong_mobile}}</td>
                                        <td>{{item.gong_username}}</td>
                                        <td>{{item.gong_gsmc}}</td>
                                        <td>{{item.chuangjianshijian}}</td>
                                        {# <td></td>
                                        <td></td>
                                        <td></td> #}
                                        <td>{% if item.order_userid==item.xuid %}{{item.xuqueren|get_cunxuname}}{%else%}{{item.gongqueren|get_cunxuname}}{%endif%}</td>
                                        <td>{% if item.order_userid==item.xuid %}{{item.gongqueren|get_querenname}}{%else%}{{item.xuqueren|get_querenname}}{%endif%}</td>
                                        <td class="text-center">
                                            <a href="/admin/order/see/?id={{item.id}}" class="text-info" data-toggle="ajaxModal">查看</a>
                                        </td>
                                        <td class="text-center">
                                            {% if not(item.gongqueren==2 or item.xuqueren==2) %}
                                            <a href="/admin/order/accomplish/?id={{item.id}}" class="text-info" data-toggle="ajaxModal">达成</a>
                                            {% endif %}
                                            <a href="/admin/order/termination/?id={{item.id}}" class="text-info" data-toggle="ajaxModal">终止</a>
                                        </td>
                                    </tr>
                                    {% else %}
                                    <tr><td colspan="20"><div class="alert alert-warning alert-block">
                                        <button data-dismiss="alert" class="close" type="button">×</button>
                                        <p>暂无数据</p>
                                    </div></td></tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                            <footer class="panel-footer">
                                <div class="row">


                                    <div class="col-sm-12 text-right text-center-xs">
                                        {{pagerData | safe}}
                                    </div>
                                </div>
                            </footer>
                        </section>
                    </section>
                </section>

{% endblock %}
{% block script%}
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
<script>
    $(function () {
      //搜索功能
      $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
          url += '&' + query;
        }else{
          url += '?' + query;
        }
        window.location.href = url;
      });

      //回车自动提交
      $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
          $("#search").click();
        }
      });

    })
</script>
{% endblock%}
